package com.example.demo.commen;

import lombok.Data;

import java.util.HashMap;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * user:likai
 * Date:2023-02-15
 * Time:19:45
 */
public class AjaxResult {
    public static HashMap<String,Object> success(Object data){
        HashMap<String,Object> result=new HashMap<>();
        result.put("code",200);
        result.put("meg","");
        result.put("data",data);
        return result;
    }
    public static HashMap<String,Object> success(String meg,Object data){
        HashMap<String,Object> hashMap=new HashMap<>();
        hashMap.put("code",200);
        hashMap.put("meg",meg);
        hashMap.put("data",data);
        return hashMap;
    }

    public static HashMap<String,Object> fail(int code,String meg){
        HashMap<String,Object> hashMap=new HashMap<>();
        hashMap.put("code",code);
        hashMap.put("meg",meg);
        hashMap.put("data","");
        return hashMap;
    }
}
